%%
%% This is file `xdthesis.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xdthesis.dtx  (with options: `cls')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2008-2013 by Fei Qi <fred.qi@gmail.com>
%% 
%% This file may be distributed and/or modified under the conditions of the LaTeX
%% Project Public License, either version 1.3a of this license or (at your option)
%% any later version. The latest version of this license is in:
%% 
%% http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3a or later is part of all distributions of LaTeX
%% version 2004/10/01 or later.
%% 
%% To produce the documentation run the original source files ending with `.dtx'
%% through LaTeX.
%% 
%% \iffalse
%%  Local Variables:
%%  mode: doctex
%%  TeX-master: t
%%  End:
%% \fi
%% \iffalse meta-comment
%%
%% Copyright (C) 2008-2011 by gprsnl <gprsnl@yeah.net>
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3a
%% of this license or (at your option) any later version.
%% The latest version of this license is in:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.3a or later is part of all distributions of LaTeX
%% version 2004/10/01 or later.
%%
%% \fi

\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{xdthesis}
[2009/06/06 0.2 Xidian University Thesis Template]
\hyphenation{XD-Thesis}
\def\xdthesis{\textsc{XDThesis}}
\def\version{0.9.4}
\newif\ifxd@bachelor\xd@bachelorfalse
\newif\ifxd@master\xd@masterfalse
\newif\ifxd@doctor\xd@doctorfalse
\newif\ifxd@secret\xd@secretfalse
\newif\ifxd@mkabstract\xd@mkabstractfalse
\newif\ifxd@print\xd@printfalse
\newif\ifxd@msfonts\xd@msfontsfalse
\DeclareOption{bachelor}{\xd@bachelortrue}
\DeclareOption{master}{\xd@mastertrue}
\DeclareOption{doctor}{\xd@doctortrue}
\DeclareOption{secret}{\xd@secrettrue}
\DeclareOption{print}{\xd@printtrue}
\DeclareOption{msfonts}{\xd@msfontstrue}
\DeclareOption{adobefonts}{\xd@msfontsfalse}
\AtEndOfClass{%
  \ifxd@bachelor\relax\else
    \ifxd@master\relax\else
      \ifxd@doctor\relax\else
        \ClassError{xdthesis}%
                   {Please specify a thesis option: bachelor, master or doctor.}{}
      \fi
    \fi
  \fi}
\ExecuteOptions{}
\ProcessOptions
\ifxd@print
\LoadClass[12pt, a4paper, openright]{book}
\else
\LoadClass[12pt, a4paper, openany]{book}
\fi
\RequirePackage{calc}
\RequirePackage[numbers,super,sort&compress]{natbib}
\ifxd@print
\RequirePackage[xetex,colorlinks=true,allcolors=black]{hyperref}
\else
\RequirePackage[xetex,colorlinks=true]{hyperref}
\fi
\RequirePackage{indentfirst}
\RequirePackage[neverdecrease]{paralist}
\RequirePackage{amsmath, amssymb}
\RequirePackage{graphicx}
\RequirePackage{subfig}
\RequirePackage[normalem]{ulem}
\RequirePackage{ifthen}
\RequirePackage{titlesec,titletoc}
\RequirePackage[CJKnumber,BoldFont]{xeCJK}
\punctstyle{quanjiao}
\def\CJK@null{\kern\CJKnullspace\Unicode{48}{7}\kern\CJKnullspace}
\defaultfontfeatures{Mapping=tex-text} % after fontspec
\ifxd@msfonts
\setCJKmainfont{SimSun}
\setCJKsansfont{SimHei}
\setCJKmonofont{KaiTi_GB2312}
\setCJKfamilyfont{song}{SimSun}
\setCJKfamilyfont{hei}{SimHei}
\setCJKfamilyfont{fs}{FangSong_GB2312}
\setCJKfamilyfont{kai}{KaiTi_GB2312}
\setCJKfamilyfont{li}{Adobe Kaiti Std}
\setCJKfamilyfont{you}{LiSu}
\else
\setCJKmainfont{Adobe Song Std}
\setCJKsansfont{Adobe Heiti Std}
\setCJKfamilyfont{song}{Adobe Song Std}
\setCJKfamilyfont{hei}{Adobe Heiti Std}
\fi
\setmainfont{Times New Roman}
\setsansfont{Arial}
\setmonofont{Courier Std}
\RequirePackage{xunicode,metalogo}
\renewcommand\frontmatter{%
  \xd@clearpage%
  \@mainmatterfalse
  \ifxd@doctor\pagenumbering{Roman}\else\pagenumbering{roman}\fi
  \pagestyle{xd@front}}
\renewcommand\mainmatter{%
  \xd@clearpage
  \@mainmattertrue
  \pagenumbering{arabic}
  \pagestyle{xd@headings}}
\renewcommand\backmatter{%
  \xd@clearpage
  \@mainmattertrue}
\newcommand{\song}{\CJKfamily{song}} % 宋体
\def\songti{\song}
\newcommand{\hei}{\CJKfamily{hei}} % 黑体
\def\heiti{\hei}
\newlength\xd@linespace
\newcommand{\xd@choosefont}[2]{%
   \setlength{\xd@linespace}{#2*\real{#1}}%
   \fontsize{#2}{\xd@linespace}\selectfont}
\def\xd@define@fontsize#1#2{%
  \expandafter\newcommand\csname #1\endcsname[1][\baselinestretch]{%
    \xd@choosefont{##1}{#2}}}
\xd@define@fontsize{chuhao}{42bp}
\xd@define@fontsize{xiaochu}{36bp}
\xd@define@fontsize{yihao}{26bp}
\xd@define@fontsize{xiaoyi}{24bp}
\xd@define@fontsize{erhao}{22bp}
\xd@define@fontsize{xiaoer}{18bp}
\xd@define@fontsize{sanhao}{16bp}
\xd@define@fontsize{xiaosan}{15bp}
\xd@define@fontsize{sihao}{14bp}
\xd@define@fontsize{banxiaosi}{13bp}
\xd@define@fontsize{xiaosi}{12bp}
\xd@define@fontsize{dawu}{11bp}
\xd@define@fontsize{wuhao}{10.5bp}
\xd@define@fontsize{xiaowu}{9bp}
\xd@define@fontsize{liuhao}{7.5bp}
\xd@define@fontsize{xiaoliu}{6.5bp}
\xd@define@fontsize{qihao}{5.5bp}
\xd@define@fontsize{bahao}{5bp}
\renewcommand\normalsize{\@setfontsize\normalsize{12bp}{18bp}}
\renewcommand\baselinestretch{1.2}
\setlength{\textwidth}{\paperwidth}
\setlength{\textheight}{\paperheight}
\setlength\marginparwidth{0cm}
\setlength\marginparsep{0cm}
\addtolength{\textwidth}{-6cm}
\setlength{\oddsidemargin}{4cm-1in}
\setlength{\evensidemargin}{2cm-1in}
\setlength{\topmargin}{1.45cm-1in}
\setlength{\headheight}{20pt}
\setlength{\headsep}{0.6cm}
\setlength{\topskip}{0pt}
\setlength{\footskip}{1pt}
\setlength{\skip\footins}{15pt}
\ifxd@doctor
\addtolength{\textheight}{-5.0cm}
\else
\addtolength{\textheight}{-4.5cm}
\fi
\def\xd@clearpage{%
  \clearpage%
  \if@openright%
    \ifodd\c@page\relax\else%
      \null\thispagestyle{xd@empty}\newpage%
    \fi%
  \fi}
\def\ps@xd@empty{%
  \let\@oddhead\@empty%
  \let\@evenhead\@empty%
  \let\@oddfoot\@empty%
  \let\@evenfoot\@empty}
\def\ps@xd@foot@doctor{\vbox{\vskip10pt\rule{\textwidth}{1mm}%
    \vskip1pt\rule{\textwidth}{0.75pt}\vskip1pt%
    \hbox to\textwidth{\hfil{\xiaowu\ps@xd@pagefoot}\hfil}}}
\def\ps@xd@front{%
  \def\@oddhead{\vbox{\hbox to\textwidth{%
        \hfil{\wuhao\noindent\leftmark}%
        \hfil{\ifxd@doctor\xiaowu\thepage\fi}\hskip1pt}%
      \vskip2pt\ifxd@doctor\rule{\textwidth}{1mm}\vskip1pt\fi%
      \rule{\textwidth}{0.75pt}}}%
  \def\@evenhead{\vbox{\hbox to\textwidth{%
        \hskip1pt{\ifxd@doctor\xiaowu\thepage\fi}%
        \hfil{\let\\=\relax\wuhao\rightmark}\hfil}%
      \vskip2pt\ifxd@doctor\rule{\textwidth}{1mm}\vskip1bp\fi%
      \rule{\textwidth}{0.75pt}}}%
  \def\@oddfoot{\ifxd@doctor\ps@xd@foot@doctor\else\@empty\fi}%
  \def\@evenfoot{\ifxd@doctor\ps@xd@foot@doctor\else\@empty\fi}}%
\def\ps@xd@headings{%
  \def\@oddhead{\vbox{\hbox to\textwidth{%
        \hfil{\wuhao\noindent\leftmark}\hfil{\xiaowu\thepage}\hskip1pt}%
      \vskip2pt\ifxd@doctor\rule{\textwidth}{1mm}\vskip1bp\fi%
      \rule{\textwidth}{0.75pt}}}%
  \def\@evenhead{\vbox{\hbox to\textwidth{%
        \hskip1pt{\xiaowu\thepage}\hfil{\let\\=\relax\wuhao\rightmark}\hfil}%
      \vskip2pt\ifxd@doctor\rule{\textwidth}{1mm}\vskip1bp\fi%
      \rule{\textwidth}{0.75pt}}}%
  \def\@oddfoot{\ifxd@doctor\ps@xd@foot@doctor\else\@empty\fi}%
  \def\@evenfoot{\ifxd@doctor\ps@xd@foot@doctor\else\@empty\fi}}
\renewcommand{\chaptermark}[1]{%
  \ifodd\c@page%
    \markboth{#1}{\xd@ctitle}%
  \else%
    \markboth{\xd@ctitle}{#1}%
  \fi}
\renewcommand{\sectionmark}[1]{}
\newlength\xd@CJK@twochars
\newcommand{\xd@unicode}[2]{\char\numexpr#1*256+#2\relax}
\def\xd@CJK@space{\xd@unicode{48}{7}}
\def\CJKindent{%
  \settowidth\xd@CJK@twochars{\xd@CJK@space\xd@CJK@space}%
  \parindent\xd@CJK@twochars}
\setlength{\parskip}{0pt \@plus2pt \@minus0pt}
\def\xd@item@space{%
  \let\itemize\compactitem
  \let\enditemize\endcompactitem
  \let\enumerate\compactenum
  \let\endenumerate\endcompactenum
  \let\description\compactdesc
  \let\enddescription\endcompactdesc}
  % \dashuline{\hbox to #1{\hfill#2\hfill}}}
\def\xddashuline[#1]#2{%
  \dashuline{\hbox to #1{\hfill#2\hfill}}
}
\def\xduline[#1]#2{%
  \uline{\hbox to #1{\hfill#2\hfill}}
}
\newcommand\boldhei{%
\fontspec[BoldFont={Adobe Heiti Std},BoldFeatures={RawFeature={embolden=2}}]{Adobe Heiti Std}
}
\newcommand\boldsong{%
\fontspec[BoldFont={Adobe Song Std},BoldFeatures={RawFeature={embolden=2}}]{Adobe Song Std}
}

\def\xd@daihao{10701}
\def\xd@xuehao{0911120728}
\def\xd@leihao{TP391.41}
\def\xd@miji{公开}

\def\xd@timuI{论文题目}
\def\xd@timuII{}
\def\xd@timuIII{}
\def\xd@timuIIII{}
\def\xd@xingming{作者姓名}
\def\xd@jiaoshi{教师姓名职称}
\def\xd@menglei{学科门类}
\def\xd@zhuanye{学科专业}
\def\xd@riqi{日期}

\newcommand\daihao[1]{\def\xd@daihao{#1}}
\newcommand\xuehao[1]{\def\xd@xuehao{#1}}
\newcommand\leihao[1]{\def\xd@leihao{#1}}
\newcommand\miji[1]{\def\xd@miji{#1}}

\newcommand\timuI[1]{\def\xd@timuI{#1}}
\newcommand\timuII[1]{\def\xd@timuII{#1}}
\newcommand\timuIII[1]{\def\xd@timuIII{#1}}
\newcommand\timuIIII[1]{\def\xd@timuIIII{#1}}
\newcommand\xingming[1]{\def\xd@xingming{#1}}
\newcommand\jiaoshi[1]{\def\xd@jiaoshi{#1}}
\newcommand\menglei[1]{\def\xd@menglei{#1}}
\newcommand\zhuanye[1]{\def\xd@zhuanye{#1}}
\newcommand\riqi[1]{\def\xd@riqi{#1}}

\newcommand{\xdcover}{%

\ifxd@master
{
\cleardoublepage
\thispagestyle{empty}
{
\bfseries\heiti\dawu
\makebox[1cm]{}\vspace{4mm}

\hspace{2mm}{代~~~~~~号}\xddashuline[4.3cm]{\boldhei\xd@daihao} \hspace*{1.4cm}
{学~~~~~~号}\xddashuline[4.3cm]{\boldhei\xd@xuehao} \vspace{3mm}

\hspace{2mm}{分~类~号}\xddashuline[4.3cm]{\boldhei\xd@leihao} \hspace*{1.4cm}
{密~~~~~~级}\xddashuline[4.3cm]{\xd@miji} \vspace{13.8cm}

\bfseries\sihao
\noindent\makebox[3.2cm][s]{\heiti 题{\xiaowu(中、英文)}目}\xddashuline[12cm]{\boldsong\songti\xd@timuI} \vspace{-3mm}

\noindent\makebox[3.2cm][s]{}\xddashuline[12cm]{\boldsong\songti\xd@timuII} \vspace{-3mm}

\noindent\makebox[3.2cm][s]{}\xddashuline[12cm]{\boldsong\xd@timuIII} \vspace{-3mm}

\noindent\makebox[3.2cm][s]{}\xddashuline[12cm]{\boldsong\xd@timuIIII}

\noindent\makebox[3.2cm][s]{\heiti 作者姓名}\xddashuline[3cm]{\songti\sanhao\xd@xingming}
\makebox[4.4cm][s]{\heiti 指导教师姓名、职务}\xddashuline[4.46cm]{\songti\sanhao\xd@jiaoshi}\vspace{-3mm}%\vspace{5mm}

\noindent\makebox[3.2cm][s]{\heiti 学科门类}\xddashuline[3cm]{\songti\sanhao\xd@menglei}
\makebox[2.5cm][s]{\heiti 学科、专业}\xddashuline[6.3cm]{\songti\sanhao\xd@zhuanye}\vspace{-1mm}%\vspace{7mm}

\noindent\makebox[3.2cm][s]{\heiti 提交论文日期}\xddashuline[12cm]{\songti\sanhao\xd@riqi}
\makebox[1cm]{}

}

\cleardoublepage
\thispagestyle{empty}
{
\begin{center}
\bfseries \sanhao
西安电子科技大学

学位论文独创性（或创新性）声明
\end{center}

\xiaosi \setlength{\baselineskip}{20pt}
秉承学校严谨的学风和优良的科学道德，本人声明所呈交的论文是我个人在导师指导下进行的研究工作及取得的研究成果。尽我所知，除了文中特别加以标注和致谢中所罗列的内容以外，论文中不包含其他人已经发表或撰写过的研究成果；也不包含为获得西安电子科技大学或其它教育机构的学位或证书而使用过的材料。与我一同工作的同志对本研究所做的任何贡献均已在论文中做了明确的说明并表示了谢意。

申请学位论文与资料若有不实之处，本人承担一切的法律责任。\\

本人签名：\xduline[3cm]{} \hspace{2.5cm} 日期：\xduline[3cm]{} \\

\vspace{2cm}
\begin{center}
\bfseries \sanhao
西安电子科技大学

关于论文使用授权的说明
\end{center}

\xiaosi \setlength{\baselineskip}{20pt}
本人完全了解西安电子科技大学有关保留和使用学位论文的规定，即：研究生在校攻读学位期间论文工作的知识产权单位属西安电子科技大学。学校有权保留送交论文的复印件，允许查阅和借阅论文；学校可以公布论文的全部或部分内容，可以允许采用影印、缩印或其它复制手段保存论文。同时本人保证，毕业后结合学位论文研究课题再撰写的文章一律署名单位为西安电子科技大学。

本人授权西安电子科技大学图书馆保存学位论文，本学位论文属于\xd@miji（保密级别），在
\xduline[1cm]{}年解密后适用本授权书，并同意将论文在互联网上发布。\\\\

本人签名：\xduline[3cm]{} \hspace{2.5cm} 日期：\xduline[3cm]{}  \\

导师签名：\xduline[3cm]{} \hspace{2.5cm} 日期：\xduline[3cm]{}
}
}
\fi
}


\renewcommand\chapter{%
  \xd@clearpage%
  \if@mainmatter\thispagestyle{xd@headings}%
  \else\thispagestyle{xd@front}\fi%
  \phantomsection%
  \global\@topnum\z@%
  \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{%
  \if@mainmatter\refstepcounter{chapter}\fi
  \addcontentsline{toc}{chapter}{\xiaosi\song\bfseries\@chapapp\hskip1ex#1}%
  \chaptermark{\@chapapp\hskip2ex#1}%
  \@makechapterhead{#2}}
\def\@makechapterhead#1{\noindent%
  \parbox[b]{\textwidth}{\vskip15mm}%
  {\centering \sanhao\hei%
    \ifnum \c@secnumdepth > \m@ne%
      \@chapapp\hskip1ex%
    \fi%
   \interlinepenalty\@M%
   #1\par\nobreak%
   \vskip4ex%
   \nointerlineskip}}
\def\@schapter#1{%
  \addcontentsline{toc}{chapter}{\xiaosi\song\bfseries#1}%
  \chaptermark{#1}%
  \@makeschapterhead{#1}
  \@afterheading}
\def\@makeschapterhead#1{\noindent%
  \parbox[b]{\textwidth}{\vskip15mm}%
  {\sanhao\hei\centering%
   \interlinepenalty\@M
   #1\par\nobreak%
   \vskip4ex%
   \nointerlineskip}}
\renewcommand\section{%
  \ifdim\prevdepth=-1000pt\dimen0=1ex%
  \else\dimen0=3ex\fi%
  \@startsection {section}{1}{\z@}%
  {\dimen0}%
  {2ex}%
  {\sihao[1.429]\filcenter}}
\titleformat{\subsection}[block]%
            {\xiaosi}{\thesubsection}%
            {1ex}{}
\renewcommand{\tableofcontents}{%
  \xd@clearpage%
  \phantomsection%
  \@makeschapterhead{\contentsname}%
  \chaptermark{\contentsname}%
  \@starttoc{toc}}
\newlength\xd@dot@space
\setlength\xd@dot@space{0.6pc}
\titlecontents{chapter}[0pt]{}%
              {\contentslabel{0pt}}%
              {\hspace*{0pt}}%
              {\titlerule*[\xd@dot@space]{.}\bfseries\contentspage}
\dottedcontents{section}[5.8em]{}{2.1em}{\xd@dot@space}
\dottedcontents{subsection}[8.8em]{}{2.7em}{\xd@dot@space}
\def\xd@define@term#1{
  \expandafter\gdef\csname #1\endcsname##1{%
    \expandafter\gdef\csname xd@#1\endcsname{##1}}
  \csname #1\endcsname{}}
\xd@define@term{subjectcode}
\xd@define@term{catelognumber}
\xd@define@term{classid}
\xd@define@term{studentid}
\xd@define@term{secretlevel}
\xd@define@term{ctitle}
\xd@define@term{cschool}
\xd@define@term{cmajor}
\xd@define@term{cfirstdiscipline}
\xd@define@term{cseconddiscipline}
\xd@define@term{cauthor}
\xd@define@term{csupervisor}
\xd@define@term{cassosupervisor}
\xd@define@term{cdate}
\xd@define@term{etitle}
\ifxd@bachelor
\def\xd@urule#1#2{\hskip2pt\underline{\hb@xt@#1{\hss#2\hss}}\hskip3pt}
\else
\def\xd@urule#1#2{\hskip2pt\dashuline{\hb@xt@#1{\hss#2\hss}}\hskip3pt}
\fi
\def\xd@put@prefix#1#2{\makebox[#1][s]{#2}}
\def\xd@titlepage{%
  \ifxd@bachelor%
    \xd@titlepage@bachelor%
  \else%
    \xd@titlepage@graduate%
  \fi}
\newcommand{\xd@titlepage@bachelor}{
  \parbox[b]{0.9\linewidth}{%
    \xiaosi[1.5]\song\bf\ignorespaces\flushright%
    \xd@put@prefix{3em}{\xd@classid@prefix}\enskip%
    \xd@urule{32mm}{\xd@classid}\par%
    \xd@put@prefix{3em}{\xd@studentid@prefix}\enskip%
    \xd@urule{32mm}{\xd@studentid}}
  \begin{center}
    \ifxd@print\vspace{132mm}\else\vspace{18mm}
    \includegraphics[width=77mm]{xdbadge}\par
    \vspace{15mm}
    \parbox[t]{\linewidth}{\chuhao\hei\centering\xd@thesis@str}\par
    \vspace{15mm}
    \includegraphics[width=44mm]{xdlogo}\par
    \vspace{18mm}\fi
    \begin{minipage}{122mm}
      \flushleft\xiaosan[2.5]\song%
      \xd@put@prefix{25mm}{\bf\xd@ctitle@prefix}
      \xd@urule{95mm}{}\par
      \xd@put@prefix{25mm}{}\xd@urule{95mm}{}\par
      \xd@put@prefix{25mm}{\bf\xd@cschool@prefix}
      \xd@urule{95mm}{\xd@cschool}\par
      \xd@put@prefix{25mm}{\bf\xd@cmajor@prefix}
      \xd@urule{95mm}{\xd@cmajor}\par
      \xd@put@prefix{25mm}{\bf\xd@cauthor@prefix}
      \xd@urule{95mm}{\xd@cauthor}\par
      \xd@put@prefix{25mm}{\bf\xd@csupervisor@prefix}
      \xd@urule{95mm}{\xd@csupervisor}
    \end{minipage}
    \vskip-87mm\hskip25mm
    \begin{minipage}{85mm}
      \xiaosan[2.5]\song\centering\ignorespaces\xd@ctitle
    \end{minipage}
  \end{center}
}
\newcommand{\xd@titlepage@graduate}{
  \parbox[b]{0.9\linewidth}{
    \dawu\heiti\bfseries\ignorespaces\flushright
    \xd@put@prefix{14mm}{\xd@subjectcode@prefix}%
    \xd@urule{45mm}{\sf\bfseries\xd@subjectcode}%
    \hspace{14mm}%
    \xd@put@prefix{14mm}{\xd@studentid@prefix}%
    \xd@urule{45mm}{\sf\bfseries\xd@studentid}\\[3mm]
    \xd@put@prefix{14mm}{\xd@catelognumber@prefix}%
    \xd@urule{45mm}{\sf\bfseries\xd@catelognumber}%
    \hspace{14mm}%
    \xd@put@prefix{14mm}{\xd@secretlevel@prefix}%
    \xd@urule{45mm}{\xd@secretlevel}}
  \ifxd@print\vspace{135mm}\else\vspace{18mm}
  \begin{center}
    \includegraphics[width=77mm]{xdbadgegr}\par
    \vspace{15mm}
    \parbox[t]{\linewidth}{\chuhao\hei\centering\xd@thesis@str}\par
    \vspace{15mm}
    \includegraphics[width=44mm]{xdlogo}\par
    \vspace{18mm}
  \end{center}
  \fi
  \renewcommand{\baselinestretch}{1.5}
  \begin{flushleft}
    \bfseries\heiti\sihao%
    \xd@put@prefix{32mm}{\xd@ctitle@prefix}%
    \xd@urule{114mm}{}\par\vskip1pt%
    \xd@put@prefix{32mm}{}\xd@urule{114mm}{}\par\vskip1pt%
    \xd@put@prefix{32mm}{}\xd@urule{114mm}{}\par\vskip1pt%
    \xd@put@prefix{32mm}{}\xd@urule{114mm}{}
  \end{flushleft}
  \vskip3mm
  \xd@put@prefix{32mm}{\bfseries\heiti\sihao\xd@cauthor@prefix}
  \xd@urule{30mm}{\song\bf\sihao\xd@cauthor}
  \xd@put@prefix{42mm}{\bfseries\heiti\sihao\xd@csupervisor@prefix}
  \xd@urule{37mm}{\song\bf\sihao\xd@csupervisor}\par\vskip5pt\noindent
  \xd@put@prefix{32mm}{\bfseries\heiti\sihao\xd@cfirstdiscipline@prefix}
  \xd@urule{30mm}{\song\bf\sihao\xd@cfirstdiscipline}
  \xd@put@prefix{23mm}{\bfseries\heiti\sihao\xd@cseconddiscipline@prefix}
  \xd@urule{57mm}{\song\bf\sihao\xd@cseconddiscipline}\par\vskip5mm\noindent
  \xd@put@prefix{32mm}{\bfseries\heiti\sihao\xd@cdate@prefix}
  \xd@urule{114mm}{\song\bf\sihao\xd@cdate}
  \noindent\vskip-77mm\hskip27mm
  \begin{minipage}{110mm}
    \centering\song\bf\sihao
    \xd@ctitle\par
    \xd@etitle
  \end{minipage}
  \renewcommand{\baselinestretch}{1.2}
}
\long\@xp\def\@xp\collect@@body\@xp#\@xp1\@xp\end\@xp#\@xp2\@xp{%
  \collect@@body{#1}\end{#2}}
\long\@xp\def\@xp\push@begins\@xp#\@xp1\@xp\begin\@xp#\@xp2\@xp{%
  \push@begins{#1}\begin{#2}}
\long\@xp\def\@xp\addto@envbody\@xp#\@xp1\@xp{%
  \addto@envbody{#1}}
\newcommand{\xd@@cauthorbio}[1]{\long\gdef\xd@cauthorbio{#1}}
\newenvironment{cauthorbio}[1]{\long\gdef\xd@bio@photo{#1}%
  \collect@body\xd@@cauthorbio}{}
\newcommand{\xd@@eauthorbio}[1]{\long\gdef\xd@eauthorbio{#1}}
\newenvironment{eauthorbio}{\collect@body\xd@@eauthorbio}{}
\def\xd@bio@photowidth{1.00in}   % width of the biography photo area
\def\xd@bio@photodepth{1.25in}   % depth (height) of the biography photo area
\def\xd@bio@hangwidth{1.15in}    % width cleared for the biography photo area
\def\xd@bio@hangdepth{1.25in}    % depth cleared for the biography photo area
\newdimen\@xdtmpdimenA
\newdimen\@xdtmpdimenB
\newcount\@xdtmpcountA
\def\xd@make@authorbio{%
  \begin{center}
    \sanhao[2]\hei{\xd@authorbio@title}
  \end{center}
  \vskip2ex%
  \def\xd@temp@photobox{\mbox{%
      \begin{minipage}[b][\xd@bio@photodepth][c]{\xd@bio@photowidth}%
        \centering \xd@bio@photo%
      \end{minipage}}}
  \settoheight{\@xdtmpdimenA}{\xd@temp@photobox}
  \@xdtmpdimenB=\xd@bio@hangdepth%
  % countA has the hang depth
  \@xdtmpcountA=\@xdtmpdimenB
  % calculates lines needed to produce the hang depth
  \divide\@xdtmpcountA by \baselineskip
  \advance\@xdtmpcountA by 1% ensure we overestimate
  % reference the top of the photo area to the top of a capital T
  \settoheight{\@xdtmpdimenB}{\mbox{T}}%
  \noindent\makebox[0pt][l]{\hspace{-\xd@bio@hangwidth}%
    \raisebox{\@xdtmpdimenB}[0pt][0pt]{%
      \raisebox{-\xd@bio@photodepth}[0pt][0pt]{\xd@temp@photobox}}}%
  \hangindent\xd@bio@hangwidth%
  \hangafter-\@xdtmpcountA%
  \indent\xd@cauthorbio\par
  \ifnum \prevgraf <\@xdtmpcountA\relax% detect when the biography text is shorter than the photo
  \advance\@xdtmpcountA by -\prevgraf% calculate how many lines we need to pad
  \advance\@xdtmpcountA by -1\relax% we compensate for the fact that we indented an extra line
  \@xdtmpdimenA=\baselineskip% calculate the length of the padding
  \multiply\@xdtmpdimenA by \@xdtmpcountA%
  \noindent\rule{0pt}{\@xdtmpdimenA}% insert an invisible support strut
  \fi%
  \xd@eauthorbio\par%
}
\def\xd@make@declaration{%
  \song\xiaosi[1.5]
  {\centering\bfseries\sanhao%
    \xd@xidian@str\par\xd@declaration@title\par}
  \vskip5pt\xd@declaration@str\vskip15mm
  \xd@put@prefix{5em}{\xd@author@presig}\underline{\hskip30mm}\hskip25mm
  \xd@put@prefix{2em}{\xd@date@presig}\underline{\hskip30mm}\par
  \vskip20mm
  \ifxd@bachelor{}\else
  {\centering\bfseries\sanhao%
    \xd@xidian@str\par\xd@authorization@title\par}
  \vskip5pt\xd@authorization@str\par
  \vskip20mm
  \xd@put@prefix{5em}{\xd@author@presig}\underline{\hskip30mm}\hskip25mm
  \xd@put@prefix{5em}{\xd@supervisor@presig} \underline{\hskip30mm}\par
  \vskip10mm
  \xd@put@prefix{4em}{\xd@date@presig}
  \underline{\hskip1em\hskip30mm}\hskip25mm
  \xd@put@prefix{4em}{\xd@date@presig}
  \underline{\hskip1em\hskip30mm}
  \fi
}
\newcommand{\makecover}{
  \begin{titlepage}
    \xd@titlepage
  \end{titlepage}
  \xd@clearpage
  \addtolength{\topmargin}{15pt}
  \ifxd@doctor
    \thispagestyle{xd@empty}
    \xd@make@authorbio
    \xd@clearpage
  \fi
  \thispagestyle{xd@empty}
  \xd@make@declaration
  \xd@clearpage
  \addtolength{\topmargin}{-15pt}
  \setcounter{page}{1}
  \xd@makeabstract
}
\renewcommand\theequation{\ifnum \c@chapter>\z@ \thechapter%
                          -\fi\@arabic\c@equation}
\let\old@tabular\@tabular
\def\xd@tabular{\wuhao\old@tabular}
\DeclareCaptionLabelFormat{xd@cap}{{\wuhao#1\rmfamily#2}}
\DeclareCaptionLabelSeparator{xd@sep}{\hspace{1em}}
\DeclareCaptionFont{xd@capfont}{\wuhao}
\captionsetup{labelformat=xd@cap,
              labelsep=xd@sep,
              font=xd@capfont,
              justification=centering}
\captionsetup[table]{position=top, belowskip={12bp-\intextsep}, aboveskip=3bp}
\captionsetup[figure]{position=bottom, belowskip={12bp-\intextsep}, aboveskip=3bp}
\captionsetup[subfloat]{font=xd@capfont,captionskip=6bp,%
                        nearskip=6bp,farskip=0bp,topadjust=0bp}
\renewenvironment{table}{%
  \renewcommand* {\@floatboxreset}{%
    \reset@font\@setminipage}
  \dawu\@float{table}%
}{%
  \end@float\normalsize
}

\newcommand{\xd@@cabstract}[1]{\long\gdef\xd@cabstract{#1}}
\newenvironment{cabstract}{\collect@body\xd@@cabstract}{}
\newcommand{\xd@@eabstract}[1]{\long\gdef\xd@eabstract{#1}}
\newenvironment{eabstract}{\collect@body\xd@@eabstract}{}
\newcommand{\xd@@ckeywords}[1]{\long\gdef\xd@ckeywords{#1}}
\newenvironment{ckeywords}{\collect@body\xd@@ckeywords}{}
\newcommand{\xd@@ekeywords}[1]{\long\gdef\xd@ekeywords{#1}}
\newenvironment{ekeywords}{\collect@body\xd@@ekeywords}{}
\newcommand{\xd@makeabstract}{%
  \xd@mkabstracttrue%
  \chapter*{\cabstractname}%
  \normalsize\par\xd@cabstract\vskip12bp%
  \setbox0=\hbox{\hei\xd@ckeywords@title\hspace{1em}}%
  \noindent\hangindent\wd0\hangafter1
  \box0{\hei\xd@ckeywords}%
  \chapter*{\bfseries\eabstractname}%
  \normalsize\par\xd@eabstract\vskip12bp%
  \setbox0=\hbox{\bfseries Keywords:\hspace{1em}}%
  \noindent\hangindent\wd0\hangafter1
  \box0{\bfseries\xd@ekeywords}%
  \xd@mkabstractfalse%
}
\bibpunct{[}{]}{,}{s}{}{,}
\renewcommand\NAT@citesuper[3]{\ifNAT@swa
\unskip\kern\p@\textsuperscript{\NAT@@open #1\NAT@@close}%
   \if*#3*\else\ (#3)\fi\else #1\fi\endgroup}
\DeclareRobustCommand\onlinecite{\@onlinecite}
\def\@onlinecite#1{\begingroup\let\@cite\NAT@citenum\citep{#1}\endgroup}
\renewenvironment{thebibliography}[1]{%
  \chapter*{\bibname}%
  \wuhao[1.5]%
  \list{\@biblabel{\@arabic\c@enumiv}}%
  {\renewcommand{\makelabel}[1]{##1\hfill}
    \settowidth\labelwidth{1.1cm}
    \setlength{\labelsep}{0.6em}
    \setlength{\itemindent}{0pt}
    \setlength{\leftmargin}{\labelwidth+\labelsep}
    \addtolength{\itemsep}{-0.7em}
    \usecounter{enumiv}%
    \let\p@enumiv\@empty
    \renewcommand\theenumiv{\@arabic\c@enumiv}}%
  \sloppy
  \clubpenalty4000
  \@clubpenalty \clubpenalty
  \widowpenalty4000%
  \interlinepenalty4000%
  \sfcode`\.\@m}
{\def\@noitemerr
  {\@latex@warning{Empty `thebibliography' environment}}%
  \endlist}
\newenvironment{acknowledgments}{\chapter*{\xd@ackname}}{}
\let\xd@appendix\appendix
\renewenvironment{appendix}{
  \xd@appendix
  \gdef\@chapapp{\appendixname~\thechapter}
}{}
\AtEndOfClass{\input{xdthesis.cfg}}%
\AtBeginDocument{\CJKindent}
\AtEndOfClass{\sloppy\xd@item@space}
\endinput
%%
%% End of file `xdthesis.cls'.
